// ProcTable.h : Stores procedure and their index and some other useful information.
// Author: Achyut P Balaji
//
#ifndef PROC_TABLE_H
#define PROC_TABLE_H

#include"../../SPA_Data_Types.h"

using namespace std;

typedef string PROC;
enum RANGE {RANGE_START,RANGE_END};

class ProcTable { 
private:

	vector<PROC> procedureList;

	vector<STATEMENT_INDEX> tempRangeStart;
	vector<STATEMENT_INDEX> tempRangeEnd;

	static ProcTable *obj;
	ProcTable();

	bool initialised;

public:

	static ProcTable* getInstance();
	static ProcTable* getFirstInstance();

	PROC_INDEX insertProc (PROC p);
	BOOLEAN insertProc(PROC_INDEX ind,STATEMENT_INDEX index,RANGE range);

	PROC getProcName (PROC_INDEX p);
	PROC_INDEX getProcIndex (PROC p);

	INTEGER getSize();

	STATEMENT_INDEX getRangeStart(PROC_INDEX p);
	STATEMENT_INDEX getRangeEnd(PROC_INDEX p);

	PROC_INDEX getProcIn(STATEMENT_INDEX n);

	void initial();
	void initialise();

};

#endif